package com.test;

import org.junit.runner.Description;
import org.junit.runner.Runner;
import org.junit.runner.notification.RunNotifier;
import org.junit.runners.model.InitializationError;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

public class SpringJUnit4ClassRunnerWrapper extends Runner {
	
	SpringJUnit4ClassRunner springJUnit4ClassRunner;
	
	public SpringJUnit4ClassRunnerWrapper(Class<?> clazz){
		try {
			System.setProperty("operation.mode", "local");
			springJUnit4ClassRunner = new SpringJUnit4ClassRunner(clazz);
		} catch (InitializationError e) {
			e.printStackTrace();
		}
	}

	@Override
	public Description getDescription() {
		return springJUnit4ClassRunner.getDescription();
	}

	@Override
	public void run(RunNotifier notifier) {
		springJUnit4ClassRunner.run(notifier);
	}
}
